﻿
@{ Layout = "~/Views/Shared/_leftPanelLayout.cshtml";}
@section LeftTree
{
     
    @{
        Html.RenderPartial("DeptTreePartialView", new Webcar.Models.DeptTreeMode { Action = "List", Controller = "Repair", ShowChild = true });
     }
}

@using (Ajax.BeginForm("ListPartialView", "Repair",Html.ViewContext.RouteData.Values, new AjaxOptions
    {
        HttpMethod = "POST",
        UpdateTargetId = "list-car",
        InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace
    }))
    { 
        @UserQuery.CreateQuery(setting => {
       setting.QueryKey = QuerySettings.RepairList;
           setting.Columns.Add(new QueryColumn() { Field = "record_no", Name = "牌照号" });
           setting.Columns.Add(new QueryColumn() { Field = "driver_name", Name = "驾驶员" });

           setting.Columns.Add(new QueryColumn() { Field = "repair_kind", Name = "维修类型", DataType = TypeofQueryColumn.DropDownList, CallBackAction = Url.Action("QueryRepairKind", "Common") });
           
           setting.Columns.Add(new QueryColumn() { Field = "enter_date", Name = "维修时间", DataType = TypeofQueryColumn.Date });
           setting.Columns.Add(new QueryColumn() { Field = "sum_fee", Name = "费用合计", DataType = TypeofQueryColumn.Number });
           setting.Columns.Add(new QueryColumn() { Field = "repair_dept", Name = "维修厂" });
           setting.Columns.Add(new QueryColumn() { Field = "repair_cause", Name = "维修原因" });
        })
}
<div id="list-car">
    @Html.Action("ListPartialView")
</div>
<hr />
<table>
    <tr>
        <td>
             @Html.DevExpress().Button(settings =>
{
    settings.Name = "Button1";
    settings.Text = "增加维修单";
    settings.Width = 100;
    settings.ControlStyle.CssClass = "button1";
    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("Edit", "Repair")+"' }";
}).GetHtml()

        </td>
<td>
     @Html.DevExpress().Button(settings =>
{
    settings.Name = "Button2";
    settings.Text = "导出Excel";
    settings.Width = 100;
    settings.ControlStyle.CssClass = "button1";
    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("Export", "Repair",Html.ViewContext.RouteData.Values) + "' }";
}).GetHtml()

</td>

    </tr>
</table>



